package com.hub.mapper.asset;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hub.entity.asset.AssetCategoryInfo;
import com.hub.dto.asset.SearchCategoryInfoDto;
import com.hub.model.asset.CategoryInfoModel;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CategoryInfoMapper extends BaseMapper<AssetCategoryInfo> {

    /**
     *
     * 分页查询
     * @param queryModel
     * @return
     */
    List<CategoryInfoModel> selectByPage(SearchCategoryInfoDto queryModel);

    /**
     * 
     * 查询父类下是否有子类
     * @param id
     * @return
     */
    int getIfExistSubCategory(int id);

    /**
     * 
     * 根据code获取分类名
     * @param code
     * @return
     */
    String getCategoryNameByCode(String code);
}
